<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<%@ page import="java.io.IOException"%>
<%@ page import="java.io.Reader"%>
<%@ page import="java.util.ArrayList"%>
<%@ page import="org.apache.ibatis.io.Resources"%>
<%@ page import="org.apache.ibatis.session.SqlSession"%>
<%@ page import="org.apache.ibatis.session.SqlSessionFactory"%>
<%@ page import="org.apache.ibatis.session.SqlSessionFactoryBuilder"%>
<%@ page import="test.vo.DeptVO"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>
<%


try {
	Reader r = Resources.getResourceAsReader("test/config/configuration.xml");
	SqlSessionFactoryBuilder build = new SqlSessionFactoryBuilder();
	SqlSessionFactory factory = build.build(r);
	SqlSession ss = factory.openSession();

	ArrayList<Object> list = (ArrayList<Object>) ss.selectList("selectDept");

	for (int i = 0; i < list.size(); i++) {
		DeptVO vo = (DeptVO)list.get(i);
		System.out.println(vo.getFoo() + "\t");
		out.println(vo.getFoo() + "<br>");
	}
} catch (IOException e) {
	e.printStackTrace();
}


%>
</body>
</html>